package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.InsectsMapper;
import com.youlai.boot.system.mapper.InterTillMapper;
import com.youlai.boot.system.model.QB.Insects;
import com.youlai.boot.system.service.InsectsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class InsectsServiceImpl extends ServiceImpl<InsectsMapper, Insects> implements InsectsService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private InsectsMapper insectsMapper;
    @Override
    public boolean saveInsects(Insects insects) {

        insects.setAddtime(LocalDateTime.now());
        return save(insects);
    }

    @Override
    public List<Insects> getAllInsects() {
        return insectsMapper.selectList(null);
    }

    @Override
    public boolean deleteInsectsById(Integer id) {
        return insectsMapper.deleteById(id)>0;
    }
}
